﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ShieldTunnel2
{
	public static class ExpertFormOptions
	{
		public static readonly ValueTuple<string, int>[] ExpertDepartmentTypes = {
			("管理单位", 2),
			("高校或科研单位", 4),
			("设计单位", 6),
			("施工单位", 8)
		};

		public static readonly ValueTuple<string, int>[] ExpertProfessionalTitles = {
			("初级职称", 3),
			("中级职称", 6),
			("副教授或高工", 9),
			("教授或教授级高工", 12)
		};

		public static readonly ValueTuple<string, int>[] ExpertAgeSections = {
			("20～30岁", 1),
			("30～40岁", 2),
			("40～50岁", 3),
			("50～60岁", 4),
			("60岁以上", 5)
		};

		public static readonly ValueTuple<string, int>[] ExpertWorkTimes = {
			("5年以下", 4),
			("5～10年", 8),
			("10～15年", 12),
			("15～20年", 16),
			("20年以上", 20)
		};

		public static readonly ValueTuple<string, int>[] ExpertRiskProfessionalLevels = {
			("听说过，不太了解", 5),
			("了解一点", 10),
			("比较了解", 15),
			("非常了解", 20),
			("从事过工程风险研究或应用", 25)
		};

		public static readonly ValueTuple<string, int>[] ExpertShieldTunnelProfessionalLevels = {
			("不太了解", 6),
			("了解一点", 12),
			("比较了解", 18),
			("相当熟悉", 24),
			("亲自参与工程建设", 30)
		};

		public static readonly string[] ImportanceLevels 
			= Enumerable.Range(1, 9).Select(i => $"{i}").ToArray();

		public static readonly string[] PossibilityLevels = {
			"很小", "小", "较小", "中等", "较大", "大", "很大"
		};

		public static int ParsePossibilityScore(string s) 
			=> PossibilityLevels.FindIndex(pl => pl == s) + 1;

		public static readonly string[] LostLevels = {
			"轻微", "不大", "较大", "严重", "惨重"
		};

		public static int ParseLostScore(string s)
			=> LostLevels.FindIndex(ll => ll == s) + 1;
	}
}
